package com.lottery.football.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.lottery.football.mapper.TeamMapper;
import com.lottery.football.pojo.Team;
import com.lottery.football.service.TeamService;
import com.lottery.football.util.Constants;

@Service(value="teamService")
public class TeamsServiceImpl implements TeamService
{
	private static String COM_500_CHARSET = Constants.GB2312;
	
	@Resource(name="teamMapper")
	private TeamMapper teamMapper;
	
	public int insert(Team team)
	{
		// 先检查是否已存在
		if (teamMapper.selectById(team.getId()) != null)
		{
			return 1;
		}
		return teamMapper.insert(team);
	}
	
	public Team selectById(int id)
	{
		return teamMapper.selectById(id);
	}
	
}
